123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575 |
- "use client";
- import Box from "@/components/Box";
- import { Link } from "@/i18n/routing";
- import { useUserInfoStore } from "@/stores/useUserInfoStore";
- import { copyText } from "@/utils/methods";
- import { LuckyWheel } from "@lucky-canvas/react";
- import { useCountDown } from "ahooks";
- import { Popup, Toast } from "antd-mobile";
- import clsx from "clsx";
- import { useTranslations } from "next-intl";
- import Image from "next/image";
- import { useRef, useState } from "react";
- import LotteryWheel from "./LotteryWheel";
- import styles from "./style.module.scss";
- const CashMainCom = () => {
- return (
- <div className={`${styles.cashMain} ${styles.cashMain} ${styles.type1}`}>
- <div className={styles.haveCash}>
- <img src="/wheel/cash.png" alt="" className={styles.cashImg} />
- <div>
- {" "}
- R$ <span className={styles.cash}>94.15</span>
- </div>
- <span className={styles.withdraw}>
- <img src="/wheel/pix.png" alt="" /> SACAR{" "}
- </span>
- </div>
- <div className={styles.progress}>
- <div className={styles.num}> 94.15%</div>
- <div className={styles.bar}>
- <span style={{ width: "calc(97.15% - 0.07rem)" }}></span>
- </div>
- </div>
- <div className={styles.needCash}>
- {" "}
- Ainda e necessário <span className={styles.needCashNum}>5.85</span> para realizar do
- saque{" "}
- </div>
- </div>
- );
- };
- const DrawMain1 = () => {
- return (
- <div className={styles.drawMain}>
- <div className={styles.draw}>
- {/*<img src="/wheel/d.png" className={styles.lamp} />*/}
- {/*<img src="/wheel/light1.png" className={styles.light1} />*/}
- {/*<img src="/wheel/light2.png" className={styles.light2} />*/}
- {/*<div className={styles.pointer}>*/}
- {/* <img src="/wheel/pointer.png" />*/}
- {/*</div>*/}
- {/*<img src="/wheel/bg_light.png" className={styles.drawBgImg} />*/}
- {/*<div className={`${styles.drawLen} ${styles.position} `}></div>*/}
- {/* <div className={styles.drawContents}>
- <canvas id={styles.draw} width={306} height={306} />
- </div> */}
- <LotteryWheel />
- </div>
- </div>
- );
- };
- const DrawContent = () => {
- return (
- <div className={styles.drawContent}>
- <div className={styles.text}>
- <span>
- <span style={{ color: "rgb(135, 149, 177)" }}>Expira em</span> 2d 19:18:13
- </span>
- </div>
- <div className={styles.cashButton}>
- <div> Convide amigos para ajudar com saques</div>
- <div className={`${styles.iconfont} ${styles.iconShare}`}></div>
- </div>
- </div>
- );
- };
- type Dtltype = "left" | "right";
- const LeftListClient = () => {
- const winListData = Array(500).fill("1");
- return (
- <>
- {winListData.length > 0 &&
- winListData.map((item, index) => {
- return (
- <div className={styles.item} key={index}>
- <span className={`${styles.name} ${styles.omitWrap}`}>
- 5533******412
- </span>
- <span className={styles.tipText}> Acabou de saca </span>
- <div className={styles.value}>
- <span className={styles.addCash}>+100</span>
- <span className={styles.unit}> R$</span>
- </div>
- </div>
- );
- })}
- </>
- );
- };
- const Report = () => {
- const [activeTab, setActiveTab] = useState<Dtltype>("left");
- const handler = (dtl: Dtltype) => {
- setActiveTab(dtl);
- };
- const activeClass = clsx(
- styles.vanTabItem,
- activeTab === "left" ? styles.vanTabAcriveLeft : styles.vanTabAcriveRight
- );
- return (
- <div className={styles.report}>
- <div className={`${styles.vanTabs} ${styles.vanTabsLine}`}>
- <div className={styles.vanTabsWrap}>
- <div className={styles.vanTabsNav}>
- <div
- className={`${styles.vanTabItem} ${activeTab === "right" ? styles.vanTabAcriveRight : ""} `}
- onClick={() => handler("left")}
- >
- <span className={activeTab === "left" ? styles.activeText : ""}>
- Relatório
- </span>
- </div>
- <div
- className={`${styles.vanTabItem} ${activeTab === "left" ? styles.vanTabAcriveLeft : ""}`}
- onClick={() => handler("right")}
- >
- <span className={activeTab === "right" ? styles.activeText : ""}>
- Minha Referencia
- </span>
- </div>
- </div>
- </div>
- <div className={styles.vanTabsContent}>
- <div className={styles.vantabpane}>
- <div className={styles.tabContent}>
- <div
- className={`${styles.winList} ${styles.swipernoswiping} ${styles.type2}`}
- >
- {activeTab === "left" ? <LeftListClient /> : null}
- </div>
- </div>
- </div>
- </div>
- </div>
- <div className={styles.rules}>
- <h2>Regras</h2>
- <ul className={styles.tipsContent}>
- <li>1.Você pode iniciar um saque quando o valor acumulado atingir 100 BRL. </li>
- <li>
- 2.Convidar amigos para se registrarem no 9f.com irá ajudá- lo a sacar
- dinheiro rapidamente.
- </li>
- <li>3. Cada usuário receberá uma única rodada grátis por dia. </li>
- <li>
- 4.Cada usuário tem um período de validade de 3 dias para cada atividade e
- pode participar da atividade várias vezes.
- </li>
- <li>
- 5.Se você receber um bônus de dinheiro extra, pode jogar jogos de graça e
- ganhar ainda mais dinheiro real.
- </li>
- <li>6.Se voce nao retirar o dinheiro dentro de 3 dias,ele ser perdido.</li>
- </ul>
- </div>
- </div>
- );
- };
- const WheelWallet = () => {
- const user = useUserInfoStore((state) => state.userInfo);
- return (
- <Box className={"absolute top-0 w-[100%]"}>
- <div
- style={{
- background: "url(/wheels/wheel-wallet.png)",
- backgroundSize: "100% 100%",
- }}
- className={"relative h-[1.4583rem] w-[100%] p-[0.1389rem]"}
- >
- <div className={"mb-[10px] text-[#49c25a]"}>
- <span className={"iconfont icon-yonghu"}></span>
- <span>Conta</span>
- <span>{user.user_phone}</span>
- </div>
- <div className={"text-[0.3472rem] font-bold text-[#008213]"}>
- R$
- <span>111</span>
- </div>
- <div className={"mt-[0.2083rem] w-[100%] text-center text-[18px]"}>
- <span className={"mr-[10px] text-[#008213]"}>Faltam para O saque</span>
- <span className={"text-[yellow]"}>R$9.36</span>
- </div>
- </div>
- </Box>
- );
- };
- const DrawMain = () => {
- const myLucky = useRef<any>();
- const desktopWheelRef = useRef<any>();
- const [blocks] = useState([
- {
- padding: "0",
- imgs: [
- {
- src: "/wheels/wheel.png",
- width: "100%",
- height: "100%",
- },
- ],
- },
- ]);
- const [prizes] = useState([
- { fonts: [{ text: "0", top: "20%" }] },
- { fonts: [{ text: "1", top: "20%" }] },
- { fonts: [{ text: "2", top: "20%" }] },
- { fonts: [{ text: "3", top: "20%" }] },
- { fonts: [{ text: "4", top: "20%" }] },
- { fonts: [{ text: "5", top: "20%" }] },
- { fonts: [{ text: "6", top: "20%" }] },
- { fonts: [{ text: "7", top: "20%" }] },
- ]);
- const [buttons] = useState([
- {
- radius: "30%",
- imgs: [
- {
- src: "/wheels/pointer.png",
- width: "100%",
- top: "-130%",
- },
- ],
- },
- ]);
- const [defaultConfig] = useState({
- offsetDegree: 20,
- });
- return (
- <div className={"relative"}>
- <WheelWallet />
- <div className={"relative hidden w-[100%] pt-[20px] sm:block"}>
- <img src={"/wheels/wheel-bg.png"} className={"w-[100%]"} />
- <img
- src={"/wheels/title.png"}
- className={"absolute left-[13%] top-[53%] z-10 w-[70%] object-cover"}
- />
- {/*定位到中心圆*/}
- <div className={"absolute bottom-[0.0347rem] h-[2.6736rem] w-[100%]"}>
- <div className={"flex h-[100%] w-[100%] justify-center text-center"}>
- {/* 图片切换动画 */}
- <img
- src="/wheels/light-1.png"
- alt=""
- className={"mr-[0.0556rem] h-[100%]"}
- />
- <div
- className={
- "mr-[0.07rem] flex h-[2.35rem] w-[2.35rem] " +
- " absolute" +
- " bottom-[0.17rem] z-50 rounded-[50%]"
- }
- >
- {/*<div*/}
- {/* className={*/}
- {/* "absolute h-[100%] w-[100%] rounded-[50%] " +*/}
- {/* " z-50 border-[red]" +*/}
- {/* ""*/}
- {/* }*/}
- {/* style={{*/}
- {/* boxShadow: "rgba(255, 255, 255, 1) 0px 0px 60px 12px inset",*/}
- {/* }}*/}
- {/*>*/}
- {/*</div>*/}
- <LuckyWheel
- ref={myLucky}
- width="2.35rem"
- height="2.35rem"
- blocks={blocks}
- defaultConfig={defaultConfig}
- prizes={prizes}
- buttons={buttons}
- onStart={() => {
- // 点击抽奖按钮会触发star回调
- myLucky.current?.play();
- setTimeout(() => {
- const index = (Math.random() * 6) >> 0;
- myLucky.current?.stop(index);
- }, 2500);
- }}
- onEnd={(prize: any) => {
- // 抽奖结束会触发end回调
- alert("恭喜你抽到 " + prize.fonts[0].text + " 号奖品");
- }}
- />
- </div>
- </div>
- </div>
- </div>
- <div className={"relative block w-[100%] pt-[20px] sm:hidden"}>
- <img src={"/wheels/wheel-bg.png"} className={"w-[100%]"} />
- <img
- src={"/wheels/title.png"}
- className={"absolute left-[13%] top-[53%] z-10 w-[70%] object-cover"}
- />
- {/*定位到中心圆*/}
- <div className={"absolute bottom-[0.0347rem]" + " h-[2.5rem]" + " w-[100%]"}>
- <div className={"flex h-[100%] w-[100%] justify-center text-center"}>
- {/* 图片切换动画 */}
- <img
- src="/wheels/light-1.png"
- alt=""
- className={"mr-[0.0556rem] h-[100%]"}
- />
- <div
- className={
- "-mr-[0.05rem] flex h-[2.3rem] w-[2.3rem] " +
- " absolute" +
- " bottom-[0.045rem]"
- }
- >
- {/*<div*/}
- {/* className={*/}
- {/* "absolute h-[100%] w-[100%] rounded-[50%] " +*/}
- {/* " z-50 border-[red]" +*/}
- {/* ""*/}
- {/* }*/}
- {/* style={{*/}
- {/* boxShadow: "rgba(255, 255, 255, 1) 0px 0px 60px 12px inset",*/}
- {/* }}*/}
- {/*>*/}
- {/*</div>*/}
- <LuckyWheel
- ref={desktopWheelRef}
- width="2.2rem"
- height="2.2rem"
- blocks={blocks}
- defaultConfig={defaultConfig}
- prizes={prizes}
- buttons={buttons}
- onStart={() => {
- // 点击抽奖按钮会触发star回调
- desktopWheelRef.current?.play();
- setTimeout(() => {
- const index = (Math.random() * 6) >> 0;
- desktopWheelRef.current?.stop(index);
- }, 2500);
- }}
- onEnd={(prize: any) => {
- // 抽奖结束会触发end回调
- alert("恭喜你抽到 " + prize.fonts[0].text + " 号奖品");
- }}
- />
- </div>
- </div>
- </div>
- </div>
- </div>
- );
- };
- const CountdownClient = () => {
- const [_, formattedRes] = useCountDown({
- leftTime: 60 * 100000,
- });
- const { days, hours, minutes, seconds } = formattedRes;
- return (
- <div className={"relative flex justify-center"}>
- <img src="/wheels/countdown-bg.png" alt="" />
- <span className={"absolute bottom-[50%] translate-y-1/2"}>
- {String(hours).padStart(2, "0")}:{String(minutes).padStart(2, "0")}:
- {String(seconds).padStart(2, "0")}
- </span>
- </div>
- );
- };
- const ShareClient = () => {
- const [visible, setVisible] = useState(false);
- const shareUrl = process.env.NEXT_PUBLIC_SHARE_URL as string;
- const url = encodeURIComponent(`${shareUrl}`);
- const text = encodeURIComponent(`Receba 100 BRL de graça,Pix SAQUE RÁPIDO`);
- const t = useTranslations();
- const SHARE_SOURCE = [
- {
- icon: "/summary/Facebook.png",
- label: "Facebook",
- shareUrl: `https://www.facebook.com/sharer/sharer.php?u=${url}&t=${text}`,
- },
- {
- icon: "/summary/WhatsApp.png",
- label: "WhatsApp",
- shareUrl: `https://api.whatsapp.com/send?text=${text}`,
- },
- {
- icon: "/summary/Telegram.png",
- label: "Telegram",
- shareUrl: `https://t.me/share/url?url=${url}&text=${text}`,
- },
- {
- icon: "/summary/Twitter.png",
- label: "Twitter",
- shareUrl: `https://twitter.com/intent/tweet?text=${text}`,
- },
- {
- icon: "/summary/Email.png",
- label: "Email",
- shareUrl: `mailto: ?&subject=&cc=&bcc=&body=${url}%0A${text}`,
- },
- ];
- const copy = (text: string) => {
- copyText(text);
- Toast.show({ icon: "success", content: t("SummaryPage.copySuc"), maskClickable: false });
- };
- return (
- <>
- <div className={"p-[0.1389rem]"}>
- <div
- className={
- "rounded-[0.1111rem] bg-gradient-to-b from-[#84ea24_20%] to-[#1b781a]" +
- " h-[0.4861rem]"
- }
- >
- <div className={"flex h-[100%] p-[0.0694rem]"}>
- <div
- className={
- "flex-1 rounded-[0.0694rem] bg-[rgba(255,255,255,0.5)]" +
- " flex items-center pl-[0.0694rem]"
- }
- >
- <span className={""}>Compartilhe mais, saque mais rápido.</span>
- </div>
- <div
- className={"flex w-[0.4167rem] items-center pl-[0.0694rem]"}
- onClick={() => setVisible(true)}
- >
- <Image src={"/wheels/share.png"} alt={"share"} width={30} height={30} />
- </div>
- </div>
- </div>
- </div>
- <Popup
- visible={visible}
- getContainer={null}
- onMaskClick={() => {
- setVisible(false);
- }}
- onClose={() => {
- setVisible(false);
- }}
- showCloseButton
- bodyStyle={{ height: "2.9rem", background: "#fff" }}
- >
- <div className={"p-[0.1389rem] text-[#555555]"}>
- <h1>1.Convide amlgos para ajudar com saques</h1>
- <div
- className={"mt-[0.1389rem] grid grid-cols-5 justify-center gap-[0.1389rem]"}
- >
- {SHARE_SOURCE.map((source, index) => {
- return (
- <a
- href={source.shareUrl}
- key={index}
- target={"_blank"}
- className={"flex flex-col items-center"}
- >
- <Image src={source.icon} alt={"Mais"} width={70} height={70} />
- <p className={"mt-[0.0347rem] text-[12px] text-[#808080]"}>
- {source.label}
- </p>
- </a>
- );
- })}
- </div>
- <div className={"mt-[0.0694rem]"}>
- <h1 className={"text-[14px]"}>
- Compartilhe este link de indicação com seus amigos
- </h1>
- <div
- className={
- "rounded-[3px] bg-[#f9f9f9] p-[0.0694rem] text-[#808080]" +
- " mt-[0.0347rem] flex items-center"
- }
- >
- <span className={"flex-1"}>{shareUrl}</span>
- <span
- id="copy"
- className={"text-[#40a1de]"}
- onClick={() => copy(shareUrl)}
- >
- {t("SummaryPage.Cópia")}
- </span>
- </div>
- </div>
- <div className={"mt-[0.0694rem]"}>
- <h1>2.Enviar convite para jogador aleatório ajudar</h1>
- <div
- className={
- "grid grid-cols-2 gap-[0.1389rem] text-[0.12rem] text-[#fff]" +
- " mt-[0.0694rem]"
- }
- >
- <Link
- href={"#"}
- className={
- "flex items-center rounded-[0.0694rem] bg-[#10cb8c]" +
- " p-[0.0694rem] text-[#fff]"
- }
- >
- <div className={"flex-1"}>
- <p>Enviar Mensagem </p>
- <p>no WhatsAPP</p>
- </div>
- <Image
- src={"/summary/WhatsApp-nobg.png"}
- alt={"whatsApp"}
- width={40}
- height={40}
- />
- </Link>
- <Link
- href={"sms:10086?body=message_body"}
- className={
- "flex items-center rounded-[10px] bg-[#35b2fe]" +
- " p-[0.0694rem] text-[#fff]"
- }
- >
- <div className={"flex-1"}>
- <p>Enviar Mensagem </p>
- <p>SMS</p>
- </div>
- <Image
- src={"/summary/SMS.png"}
- alt={"whatsApp"}
- width={40}
- height={40}
- />
- </Link>
- </div>
- </div>
- </div>
- </Popup>
- </>
- );
- };
- const CashWheelClient = () => {
- return (
- <>
- <DrawMain />
- {/*倒计时*/}
- <CountdownClient />
- {/*分享*/}
- <ShareClient />
- <div className={styles.cashWheelClient}>
- {/*<CashMainCom />*/}
- {/*<DrawContent />*/}
- <Report />
- {/*<LotteryWheel />*/}
- </div>
- </>
- );
- };
- export default CashWheelClient;
|